//
//  HomeViewCell.swift
//  PhotoBrowser
//
//  Created by 游强辉 on 16/4/28.
//  Copyright © 2016年 youqianghui. All rights reserved.
//

import UIKit
import SDWebImage

class HomeViewCell: UICollectionViewCell {
    
    @IBOutlet weak var imageView: UIImageView!
    var picture : Picture? {
        didSet {
            //1.nil值校验
            guard let str = picture?.q_pic_url else {
                return
            }
            
            //2.创建URL
            let url = NSURL(string: str)
            
            //3.设置图片
            imageView.sd_setImageWithURL(url!, placeholderImage: UIImage(named: "empty_picture"))
        }
    }
    
}
